<template>
    <div>

    </div>
</template>
<script>
import * as homeApi from "api/home-api"; // 引入api
import { ERR_OK } from "config/index"; // 引入请求成功状态
import Cookie from 'js-cookie'
import { setToken } from "@/util/auth";
import { encrypt, decrypt } from "@/util/jsencrypt.js";
export default {
  data() {
    return {
      num: 0
    };
  },
  methods: {
    // 请求方法
    login() {
      let params = {
        password: "*******",
        storeNo: "",
        userName: "*********"
      };
      homeApi
        .loginUserNo(params)
        .then(res => {
          let { data } = res;
          if (data.success === ERR_OK) {
            // 请求成功操作，存储token
            localStorage.setItem("token", data.value.token);
            Cookie.set('token',token);
            Cookie.get('token');
          } else {
          }
        })
        .catch(() => {});
    }
  }
};
</script>
<style scoped>
</style>


